package com.example.administrator.dc.Bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/8/15.
 */

public class School {


    /**
     * bid : 18
     * title : 非典型校花李佳琳：你能想到的恐怖片我都看过
     * gender : 1
     * address : https://mp.weixin.qq.com/s?__biz=MzU3ODAxMDA2OA==&amp;mid=2247483674&amp;idx=1&amp;sn=746477c5d24ce26deab75f98a2d28b97&amp;chksm=fd7aafa1ca0d26b7f8c9b0d4839eaea7983800967f72dc6a2ef4e9959426e331a4664404e5f9#rd
     * photo : http://118.89.227.169/Public/Uploads/bestphotos/20170521234739755.jpeg
     * createtime : 2017-05-21 23:47:39
     * read : 773
     * love : 378
     */

    private int bid;
    private String title;
    private int gender;
    private String address;
    private String photo;
    private String createtime;
    private int read;
    private String love;

    public static School objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), School.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setBid(int bid) {
        this.bid = bid;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public void setRead(int read) {
        this.read = read;
    }

    public void setLove(String love) {
        this.love = love;
    }

    public int getBid() {
        return bid;
    }

    public String getTitle() {
        return title;
    }

    public int getGender() {
        return gender;
    }

    public String getAddress() {
        return address;
    }

    public String getPhoto() {
        return photo;
    }

    public String getCreatetime() {
        return createtime;
    }

    public int getRead() {
        return read;
    }

    public String getLove() {
        return love;
    }
}
